home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Tools & Apps / OS⁄Toolbox / System 7 Icons Interfaces / Icons.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-28  |  7.9 KB  |  311 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Icons.h
  3.  
  4.     Contains:    Public C Interfaces for color icon plotting routines
  5.  
  6.     Copyright:    © 1990, 1992 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #ifndef __ICONS__
  11. #define __ICONS__
  12.  
  13. #ifndef __TYPES__
  14. #include <Types.h>
  15. #endif
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <QuickDraw.h>
  19. #endif
  20.  
  21. enum {
  22.  
  23.  
  24. /* The following are icons for which there are both icon suites and SICNs. */
  25.  genericDocumentIconResource = -4000,
  26.  genericStationeryIconResource = -3985,
  27.  genericEditionFileIconResource = -3989,
  28.  genericApplicationIconResource = -3996,
  29.  genericDeskAccessoryIconResource = -3991,
  30.  
  31.  genericFolderIconResource = -3999,
  32.  privateFolderIconResource = -3994,
  33.  
  34.  floppyIconResource = -3998,
  35.  trashIconResource = -3993,
  36.  
  37. /* The following are icons for which there are SICNs only. */
  38.  desktopIconResource = -3992,
  39.  openFolderIconResource = -3997,
  40.  genericHardDiskIconResource = -3995,
  41.  genericFileServerIconResource = -3972,
  42.  genericSuitcaseIconResource = -3970,
  43.  genericMoverObjectIconResource = -3969,
  44.  
  45. /* The following are icons for which there are icon suites only. */
  46.  genericPreferencesIconResource = -3971,
  47.  genericQueryDocumentIconResource = -16506,
  48.  genericExtensionIconResource = -16415,
  49.  
  50.  systemFolderIconResource = -3983,
  51.  appleMenuFolderIconResource = -3982
  52. };
  53. enum {
  54.  startupFolderIconResource = -3981,
  55.  ownedFolderIconResource = -3980,
  56.  dropFolderIconResource = -3979,
  57.  sharedFolderIconResource = -3978,
  58.  mountedFolderIconResource = -3977,
  59.  controlPanelFolderIconResource = -3976,
  60.  printMonitorFolderIconResource = -3975,
  61.  preferencesFolderIconResource = -3974,
  62.  extensionsFolderIconResource = -3973,
  63.  
  64.  fullTrashIconResource = -3984
  65.  
  66.  
  67. #define large1BitMask 'ICN#'
  68. #define large4BitData 'icl4'
  69. #define large8BitData 'icl8'
  70. #define small1BitMask 'ics#'
  71. #define small4BitData 'ics4'
  72. #define small8BitData 'ics8'
  73. #define mini1BitMask 'icm#'
  74. #define mini4BitData 'icm4'
  75. #define mini8BitData 'icm8'
  76. };
  77.  
  78. /*  alignment type values  */
  79. typedef short    IconAlignmentType;
  80.  
  81. enum {
  82. atNone = 0x0,
  83. atVerticalCenter = 0x1,
  84. atTop = 0x2,
  85. atBottom = 0x3,
  86. atHorizontalCenter = 0x4,
  87. atAbsoluteCenter = (atVerticalCenter | atHorizontalCenter),
  88. atCenterTop = (atTop | atHorizontalCenter),
  89. atCenterBottom = (atBottom | atHorizontalCenter),
  90. atLeft = 0x8,
  91. atCenterLeft = (atVerticalCenter | atLeft),
  92. atTopLeft = (atTop | atLeft),
  93. atBottomLeft = (atBottom | atLeft),
  94. atRight = 0xC,
  95. atCenterRight = (atVerticalCenter | atRight),
  96. atTopRight = (atTop | atRight),
  97. atBottomRight = (atBottom | atRight)
  98. };
  99.  
  100. /*  transform type values  */
  101. typedef short    IconTransformType;
  102.  
  103. enum {
  104. ttNone = 0x0,
  105. ttDisabled = 0x1,
  106. ttOffline = 0x2,
  107. ttOpen = 0x3,
  108. ttLabel1 = 0x0100,
  109. ttLabel2 = 0x0200,
  110. ttLabel3 = 0x0300,
  111. ttLabel4 = 0x0400,
  112. ttLabel5 = 0x0500,
  113. ttLabel6 = 0x0600,
  114. ttLabel7 = 0x0700,
  115. ttSelected = 0x4000,
  116. ttSelectedDisabled = (ttSelected | ttDisabled),
  117. ttSelectedOffline = (ttSelected | ttOffline),
  118. ttSelectedOpen = (ttSelected | ttOpen)
  119. };
  120.  
  121. /*  Selector mask values  */
  122. typedef unsigned long    IconSelectorValue;    
  123.  
  124. enum {
  125. svLarge1Bit = 0x00000001,
  126. svLarge4Bit = 0x00000002,
  127. svLarge8Bit = 0x00000004,
  128. svSmall1Bit = 0x00000100,
  129. svSmall4Bit = 0x00000200,
  130. svSmall8Bit = 0x00000400,
  131. svMini1Bit = 0x00010000,
  132. svMini4Bit = 0x00020000,
  133. svMini8Bit = 0x00040000,
  134. svAllLargeData = 0x000000ff,
  135. svAllSmallData = 0x0000ff00,
  136. svAllMiniData = 0x00ff0000,
  137. svAll1BitData = (svLarge1Bit | svSmall1Bit | svMini1Bit),
  138. svAll4BitData = (svLarge4Bit | svSmall4Bit | svMini4Bit),
  139. svAll8BitData = (svLarge8Bit | svSmall8Bit | svMini8Bit),
  140. svAllAvailableData = 0xffffffff
  141. };
  142.  
  143. typedef pascal OSErr (*IconAction)(ResType theType, Handle *theIcon, void *yourDataPtr);
  144. typedef pascal Handle (*IconGetter)(ResType theType, void *yourDataPtr);
  145.  
  146. #ifdef __cplusplus
  147. extern "C" {
  148. #endif
  149.  
  150. pascal OSErr PlotIconID(const Rect *theRect,
  151.                             IconAlignmentType align,
  152.                             IconTransformType transform,
  153.                             short theResID)
  154.     = {0x303C, 0x0500, 0xABC9};
  155.     
  156. pascal OSErr NewIconSuite(Handle *theIconSuite)
  157.     = {0x303C, 0x0207, 0xABC9};
  158.     
  159. pascal OSErr AddIconToSuite(Handle theIconData,
  160.                             Handle theSuite,
  161.                             ResType theType)
  162.     = {0x303C, 0x0608, 0xABC9};
  163.     
  164. pascal OSErr GetIconFromSuite(Handle *theIconData,
  165.                             Handle theSuite,
  166.                             ResType theType)
  167.     = {0x303C, 0x0609, 0xABC9};
  168.     
  169. pascal OSErr ForEachIconDo(Handle theSuite,
  170.                             IconSelectorValue selector,
  171.                             IconAction action,
  172.                             void *yourDataPtr)
  173.     = {0x303C, 0x080A, 0xABC9};
  174.     
  175. pascal OSErr GetIconSuite(Handle *theIconSuite,
  176.                             short theResID,
  177.                             IconSelectorValue selector)
  178.     = {0x303C, 0x0501, 0xABC9};
  179.     
  180. pascal OSErr DisposeIconSuite(Handle theIconSuite,
  181.                             Boolean disposeData)
  182.     = {0x303C, 0x0302, 0xABC9};
  183.     
  184. pascal OSErr PlotIconSuite(const Rect *theRect,
  185.                             IconAlignmentType align,
  186.                             IconTransformType transform,
  187.                             Handle theIconSuite)
  188.     = {0x303C, 0x0603, 0xABC9};
  189.     
  190. pascal OSErr MakeIconCache(Handle *theHandle,
  191.                             IconGetter makeIcon,
  192.                             void *yourDataPtr)
  193.     = {0x303C, 0x0604, 0xABC9};
  194.     
  195. pascal OSErr LoadIconCache(const Rect *theRect,
  196.                             IconAlignmentType align,
  197.                             IconTransformType transform,
  198.                             Handle theIconCache)
  199.     = {0x303C, 0x0606, 0xABC9};
  200.  
  201. pascal OSErr PlotIconMethod(const Rect *theRect,
  202.                             IconAlignmentType align,
  203.                             IconTransformType transform,
  204.                             IconGetter theMethod,
  205.                             void *yourDataPtr)
  206.     = {0x303C, 0x0805, 0xABC9};
  207.     
  208. pascal OSErr GetLabel(short labelNumber,
  209.                             RGBColor *labelColor,
  210.                             Str255 labelString)
  211.     = {0x303c, 0x050B, 0xABC9};
  212.     
  213. pascal Boolean PtInIconID(Point testPt,
  214.                             Rect *iconRect,
  215.                             IconAlignmentType alignment,
  216.                             short iconID)
  217.     = {0x303c, 0x060D, 0xABC9};
  218.     
  219. pascal Boolean PtInIconSuite(Point testPt,
  220.                             Rect *iconRect,
  221.                             IconAlignmentType alignment,
  222.                             Handle theIconSuite)
  223.     = {0x303c, 0x070E, 0xABC9};
  224.     
  225. pascal Boolean PtInIconMethod(Point testPt,
  226.                             Rect *iconRect,
  227.                             IconAlignmentType alignment,
  228.                             IconGetter theMethod,
  229.                             void *yourDataPtr)
  230.     = {0x303c, 0x090F, 0xABC9};
  231.     
  232. pascal Boolean RectInIconID(Rect *testRect,
  233.                             Rect *iconRect,
  234.                             IconAlignmentType alignment,
  235.                             short iconID)
  236.     = {0x303c, 0x0610, 0xABC9};
  237.     
  238. pascal Boolean RectInIconSuite(Rect *testRect,
  239.                             Rect *iconRect,
  240.                             IconAlignmentType alignment,
  241.                             Handle theIconSuite)
  242.     = {0x303c, 0x0711, 0xABC9};
  243.     
  244. pascal Boolean RectInIconMethod(Rect *testRect,
  245.                             Rect *iconRect,
  246.                             IconAlignmentType alignment,
  247.                             IconGetter theMethod,
  248.                             void *yourDataPtr)
  249.     = {0x303c, 0x0912, 0xABC9};
  250.     
  251. pascal OSErr IconIDToRgn(RgnHandle theRgn,
  252.                             Rect *iconRect,
  253.                             IconAlignmentType alignment,
  254.                             short iconID)
  255.     = {0x303c, 0x0613, 0xABC9};
  256.     
  257. pascal OSErr IconSuiteToRgn(RgnHandle theRgn,
  258.                             Rect *iconRect,
  259.                             IconAlignmentType alignment,
  260.                             Handle theIconSuite)
  261.     = {0x303c, 0x0714, 0xABC9};
  262.     
  263. pascal OSErr IconMethodToRgn(RgnHandle theRgn,
  264.                             Rect *iconRect,
  265.                             IconAlignmentType alignment,
  266.                             IconGetter theMethod,
  267.                             void *yourDataPtr)
  268.     = {0x303c, 0x0915, 0xABC9};
  269.     
  270. pascal OSErr SetSuiteLabel(Handle theSuite, short theLabel)
  271.     = {0x303C, 0x0316, 0xABC9};
  272.  
  273. pascal short GetSuiteLabel(Handle theSuite)
  274.     = {0x303C, 0x0217, 0xABC9};
  275.  
  276. pascal OSErr GetIconCacheData(Handle theCache, void **theData)
  277.     = {0x303C, 0x0419, 0xABC9};
  278.         
  279. pascal OSErr SetIconCacheData(Handle theCache, void *theData)
  280.     = {0x303C, 0x041A, 0xABC9};
  281.         
  282. pascal OSErr GetIconCacheProc(Handle theCache, IconGetter *theProc)
  283.     = {0x303C, 0x041B, 0xABC9};
  284.         
  285. pascal OSErr SetIconCacheProc(Handle theCache, IconGetter theProc)
  286.     = {0x303C, 0x041C, 0xABC9};
  287.     
  288. pascal OSErr PlotIconHandle(const Rect *theRect,
  289.                             IconAlignmentType align,
  290.                             IconTransformType transform,
  291.                             Handle theIcon)
  292.     = {0x303C, 0x061D, 0xABC9};
  293.     
  294. pascal OSErr PlotSICNHandle(const Rect *theRect,
  295.                             IconAlignmentType align,
  296.                             IconTransformType transform,
  297.                             Handle theSICN)
  298.     = {0x303C, 0x061E, 0xABC9};
  299.     
  300. pascal OSErr PlotCIconHandle(const Rect *theRect,
  301.                             IconAlignmentType align,
  302.                             IconTransformType transform,
  303.                             CIconHandle theCIcon)
  304.     = {0x303C, 0x061F, 0xABC9};
  305.     
  306. #ifdef __cplusplus
  307. }
  308. #endif
  309.  
  310. #endif
  311.